.make-margins(@spacers) {
    .generate-margins(length(@spacers));

    .generate-margins(@name, @i: 1) when (@i =< length(@spacers)) {
        @name: extract(@spacers, @i);
        @spacer: "spacer-@{name}";

        .u-margin-@{name} {
            margin: @@spacer  !important;
        }

        .u-margin-t-@{name} {
            margin-top: @@spacer  !important;
        }

        .u-margin-r-@{name} {
            margin-right: @@spacer  !important;
        }

        .u-margin-b-@{name} {
            margin-bottom: @@spacer  !important;
        }

        .u-margin-l-@{name} {
            margin-left: @@spacer  !important;
        }

        .u-margin-x-@{name} {
            margin-right: @@spacer  !important;
            margin-left: @@spacer  !important;
        }

        .u-margin-y-@{name} {
            margin-top: @@spacer  !important;
            margin-bottom: @@spacer  !important;
        }

        .generate-margins(@name, @i + 1);
    }
}

.make-margins(@spacer-list);

.u-margin-0 {
    margin: 0
}

.u-margin-l-auto {
    margin-left: auto;
}

.u-margin-r-auto {
    margin-right: auto;
    margin-left: auto;
}

.u-margins-x {

    >div,
    >ul,
    >a,
    >p,
    >li {
        margin-bottom: @gutter-xl  !important;

        &:last-child {
            margin-bottom: 0;
        }
    }
}